cmake_minimum_required( VERSION 2.8 )
project(data_capture)

set( CMAKE_CXX_FLAGS "-std=c++14" )

set(CMAKE_C_FLAGS "-pthread -std=gnu99")
set(CMAKE_EXE_LINKER_FLAGS "-pthread")
set(CMAKE_C_COMPILER "gcc")
set(CMAKE_CXX_COMPILER "g++")

execute_process(COMMAND uname -m
        OUTPUT_VARIABLE DEVICE_SYSTEM_ID)
message(WARNING " device system id: ${DEVICE_SYSTEM_ID}")

if (DEVICE_SYSTEM_ID MATCHES x86_64)
    add_definitions(-DPLATFORM_ARCH_x86_64=1)
elseif (DEVICE_SYSTEM_ID MATCHES aarch64)
    add_definitions(-DPLATFORM_ARCH_aarch64=1)
else ()
    message(FATAL_ERROR "FATAL: Please confirm your platform.")
endif ()


find_package( OpenCV 4 REQUIRED)


include_directories( 
	src
	src/imu_sdk
  	${OpenCV_INCLUDE_DIRS}
  )


add_executable(data_capture  		src/main.cpp
									src/stereo_capture.cpp
									src/imu_capture.cpp
									src/imu_sdk/wit_c_sdk.cpp
									src/gps_nmea.cpp)


target_link_libraries( data_capture  	${OpenCV_LIBS})


